/*
 * CodeSaveCommand.java
 *
 * Created on 2006년 3월 29일 (수), 오후 4:11
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.welfare.admin.call;

import java.util.*;






import javax.servlet.*;
import javax.servlet.http.*;

import org.json.simple.JSONObject;

import com.zll.framework.model.HashBox;
import com.zll.framework.model.HashList;
import com.zll.framework.servlet.Command;
import com.zll.framework.util.StringUtil;





/**
 *
 * @author eastar
 */
public class CustomerSearchCommand implements Command
{
	
    public String execute(HttpServletRequest  request, HttpServletResponse response)
    throws Exception
    {
    	HashBox box = new HashBox(request);

    	CallDAO dao 		= new CallDAO();

    	HashList customerList = dao.searchCustomer(box.getParam());


    	JSONObject json = new JSONObject();
    	json.put("customer_count", String.valueOf(customerList.size()));
    	json.put("customer_list", customerList);

    	request.setAttribute("jsonData", json.toString());


		return "/common/json_view.jsp";

    }
}
